package com.itheima.chapter10.thread.demo14;
//死锁

public class Demo {
    public static void main(String[] args) {
        Object objA =new Object();
        Object objB =new Object();
        new Thread(()->{while(true){
            synchronized (objA){
                synchronized (objB){
                    System.out.println("小康在路上");
                }
            }
        }}).start();

        new Thread(()->{while(true){
            synchronized (objB){
                synchronized (objA){
                    System.out.println("小V在路上");
                }
            }
        }}).start();
    }
}
